﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainFrame.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<GPMS.Model.GraduationProject>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    选题列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        选题列表</h2>
    <table id="tablelist1">
        <tr>
            <th>
                课题名称
            </th>
            <th>
                简介及要求
            </th>
            <th>
                类别
            </th>
            <th>
                发布时间
            </th>
            <th>
                指导老师
            </th>
            <th>
                最大人数
            </th>
            <th>
                已有人数
            </th>
            <th>
                操作
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%: item.GPName %>
            </td>
            <td>
                <%: item.Description %>
            </td>
            <td>
                <%: item.Type %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.CreateDate) %>
            </td>
            <td>
                <%: (ViewData["guider"] as Dictionary<Guid,string>)[item.GPID]%>
            </td>
            <td>
                <%: item.Maxman %>
            </td>
            <td>
                <%: (ViewData["dic"] as Dictionary<Guid,int>)[item.GPID] %>
            </td>
            <td>
            <%if ((ViewData["selected"] as Dictionary<Guid,bool>)[item.GPID])
              {%>
                已选择
              <%}
              else
              {%>
                  <%: Html.ActionLink("选择", "ProjectSelect", "GPSelection", new { id = item.GPID }, new { @class = "dialog" })%>
              <%}%>
                
            </td>
        </tr>
        <% } %>
    </table>
    <script type="text/javascript">
        $(function () {
            tableToGrid($("#tablelist1"), { width: 900, height: 600 });
            InitDialogLink($("a.dialog"), $("#dialogPanel"));
        });
        var reflashTag = {};
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
    <link href="<%=Url.Content("~/Content/css/ui.jqgrid.css") %>" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/i18n/grid.locale-cn.js") %>"></script>
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery.jqGrid.min.js") %>"></script>
</asp:Content>
